Page({
  data: {
    detailList:{},
    lists: [
      {
        "id": '01',
        "title": "居然之家大兴店冲电站",
        "type": "限时免费停车",
        "subTitle": "出示带日期的充电记录出示带日期的充电记录出示带日期的充电记录",
        "money": '1.46',
        "distance": '2.67'
      },
      {
        "id": '02',
        "title": "嘉悦广场充电站",
        "type": "免费停车",
        "subTitle": "出示带日期的充电记录出示带日期的充电记录出示带日期的充电记录",
        "money": '1.38',
        "distance": '6.29'
      }
    ],
  },
  onLoad: function (options) {
    // 页面初始化 options为页面跳转所带来的参数
    var id = options.id;
    let list = this.data.lists;
    var that = this;
    list.forEach(function (arr) {
      console.log(arr.id.toString())
      console.log(id)
      if (id == arr.id) {
        that.setData({
          detailList: arr
        })
      }
    })
    console.log(this.data.detailList)
  },
  onReady: function () {

    // 页面渲染完成
  },
  onShow: function () {
    // 页面显示
  },
  onHide: function () {
    // 页面隐藏
  },
  onUnload: function () {
    // 页面关闭
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function (res) {
    return {
      title: '',
      desc:'',
      path: "/pages/detail/index?id="
    }
  }
  // onShareAppMessage: function () {
  //   return {
  //     title: this.data.Article.Title,
  //     desc: this.data.Article.Description,
  //     path: "/pages/detail/index?id=" + lookid.id
  //   }
  // }
})
